February 13, 2015

The Problem of Data Visualization

  • Data use is increasing rapidly within the education space
  • Policymakers are under increasing pressure to use data to inform decisions, justify funding, and guide practice
  • But, policymakers are often not statisticians, researchers, or quants
  • Data visualization is a way to bridge this gap
  • Proper data visualization will bring the data to the audience in a way they can understand quickly and use to inform decisions

Follow Along

What is dataviz?

Dataviz is…

  • An exploratory tool for understanding datasets
  • A communication tool for framing decisions and depicting problems
  • A way to showcase
  • A better way to present results of analyses

Dataviz is not…

  • Easy
  • A replacement for analysis
  • Infographics
  • Easy!

A Definition

Data visualization is a tool for communicating a specific feature of a dataset in an approachable and efficient manner

The Challenge

If a picture is worth a thousand words, a good data visualization must always be better than a table.

Student Growth

Objectives

  1. Review data visualization principles
  2. Activity!
  3. Look at applications in education data
  4. Best practices and advice
  5. Review tools to use

Example

How can we improve this simple scatterplot?

Chart Elements

There are a few things that all charts need [most of the time!]:

  • Axis labels and a title : These make the chart self-explanatory
  • A legend : How are visual cues mapped to data?
  • A scale : How are units mapped to the visual space
  • Annotations : Author and data source (depending on distribution)

These add up to provide context and meaning to viewers who have not analyzed the dataset themselves.

Principles

  • Elements of a chart
  • Chart Types and Data Types
  • Dimensionality
  • Scale
  • Complexity
  • Technical details
  • Beyond charts

Dimensions

  • Charts and data are made up of dimensions (e.g. a bar chart is x and y)
  • Additional dimensions can be represented by additional aesthetics or chart elements (e.g. color, size, shape, etc.)
  • Dimensions can also be shown by multiple plots (e.g. a filmstrip)
  • Smart use of dimensions allows us to increase the information density of our charts

Rule of Dimensionality

How you turn dimensions in the data into visual cues for your audience is everything.

Reviewing Chart Types

Stacked Bar

Box and Whisker

Bullet Chart

Calendar

Lines

Parallel Sets

Tree Map

Word Cloud

Data Types

  • Any given dimension may be measured at different levels of measure [derived by Stanley Smith Stevens in the 1940s and 50s]
  • Nominal: unordered categories of data (e.g. race)
  • Ordinal: ordered categories of data, relative size and degree of difference between categories is unknown (e.g. Likert scales, proficiency levels, etc.)
  • Interval: ordered categories of data, fixed width (e.g. grade level in school, GPA)
  • Continuous (ratio): a measurement scale in a continuous space with a meaningful zero (e.g. scale scores)

Mapping Levels of Measure to Visual Cues

Aesthetics for Mapping

How do we map levels of measurement onto visual features of charts?

Aesthetic Discrete Continuous
Color Disparate colors Sequential or divergent colors
Size Unique size for each value mapping to radius of value
Shape A shape for each value does not make sense

Mapping That Does Not Work

Ordered vs. Unordered

Aesthetic Ordered Unordered
Color Sequential or divergent colors Rainbow
Size Increasing or decreasing radius does not make sense
Shape does not make sense A shape for each value

Mapping That Does Not Work (2)

Some tips

  • Focus on the content and the context
  • Know your audience, understand their limits, then push them!
  • Use best practices, except when they don't help
  • Experiment and iterate!

Charting Categorical Data

Charting Ordinal Data

Charting Interval/Continuous Data

Maps

Think like a map. Data density and easy interpretability.

Maps

Group Exercise

Data

  • Type of Disability
  • Language Proficiency
  • School of Attendance
  • Math Score
  • Reading Curriculum
  • Discipline incidents

Example

Example

Complexity

How do we display thousands or hundreds of thousands of observations with varying data types across multiple dimensions?

  1. Summarize the data
  • Display summary statistics visually depicting the central tendency and spread of data
  1. Plot the raw data
  • Annotate wisely to display the main message
  1. Model the data
  • Use a statistical model to summarize features of the data

Summarizing Data

  • The most simple summaries are measures of central tendency, most easily understood
  • It is important to look at the spread of data too though
  • If time is of interest, we are interested in trends
  • If space is of interest, we are interested in maps or spatial distributions
  • Think about context and reference
  • Let's look at an example summarizing student data to schools!

Plotting Means

Here is a simple plot of mean school reading scores:

But, what's wrong with this plot?

Mistakes

  • No sense of scale
  • Means can be skewed
  • Simple means are not meaningful
  • With assessment scores we need to know grade distribution
  • Let's try to improve this

Adding a Dimension

Even More Dimensions

Annotation

Annotate the assessment data for context.

Caterpillar Plots

Raw Data

Sometimes, we can get away with showing the raw data, that is, all data points. We may want to do this for a few reasons:

  • the "wow" effect,
  • because it is easier,
  • or because it looks better aesthetically.

How could it be done?

600,000 Observations Too Many

Strategies for Presenting Big Data

  • Without reducing the data points we need to do one or more of three things to be successful
  1. Spread the data out
  2. Bin the data into groups
  3. Annotate and add references

Spreading the Data Out

  1. Repeat the plot for subgroups
  • Allow the viewer to draw comparisons across small plots
  1. Reduce the ink
  • Each point has too much "weight", so make them weigh less
  1. Add Reference Points
  • 600,000 observations in one panel is not meaningful and overwhelms the viewer

What About This

  • Edward Tufte and others recommend small multiples, a technique of repeating a plot across groups to compare relationships in multiple dimensions

Even Smaller Multiples

Binning Data

Modeling the Data

All models are wrong. Some models are useful.

Smoothers

Comparing Model Performance

Aiding in Model Choice

Regression Trees

Illustrating a Model through Simulation

Simulating Outcomes

Combining Features

We can combine these features.

  • Facets with smoother lines for references (small multiples + models)
  • Summary plots with raw data in the background
  • Reference lines and group comparisons

Animation Example

Why does this work?

  • Annotation
  • Labeling
  • Lots of data-ink
  • Reference points galore

Some tips

  • Have a properly chosen format and design
  • Use words, numbers and drawing together
  • Reflect a balance, a proportion, relevant scale
  • Display an accessible complexity of details
  • Have a narrative quality, tell a story
  • Avoid content-free decoration (Tufte's proverbial chartjunk)
  • Draw in a professional manner with an eye on the technical details
  • Provide your audience with the context they need and remember they haven't lived in the data like you!

Themes

They can communicate, confound, brand, and distract

Technical Details

Don't forget them.

Graphics Files

Raster

  • Files like jpg , png , gif.
  • Fixed scale, aspect ratio, and size
  • Reasonable file size
  • Viewable in almost any image viewing and editing system, including any modern web browser, PowerPoint, etc.

Vector

  • Files like pdf and svg
  • Infinitely zoomable, adjustable on the fly
  • Larger file size
  • Viewable and usable in fewer systems. SVGs can be used in modern web browsers. PDFs included in other PDF reports.

Programming vs. Illustrating

Keep in mind that depending on the project you may need to programatically make data visualizations, or you may need a highly customized illustrated graphic.

Technologies

The technology you choose to do visualizations is largely a question of personal productivity, but with some important caveats:

  • In the future, more and more content is going to be delivered in a paperless world, so pick a technology that can leverage web/tablet/phone interfaces
  • Different technologies are useful for different levels of finish and polish; Adobe Illustrator is great for publication quality graphics, R is a great tool for rapidly prototyping different visualizations
  • Chose a technology that best serves your consumer, not you the producer. Charts are a service to the consumer, not to the creator.

Some Opinions on Technologies

Beyond Graphics

We have a number of other techniques we can use beyond simple charts.

  • Animations
  • Interactive demos
  • Summary tables
  • Videos
  • Web sites
  • Simulations

References

References (cont'd)

Where to Learn Online?

Review of Key Concepts

  • Dimensionality
  • Aesthetics and Mappings
  • Small multiples
  • Spreading the data out
  • Web vs. print

  • Adapt and iterate
  • Modeling the data
  • Themes and style
  • Techniques and software

Contact Information

Backmatter

print(sessionInfo(),locale=FALSE)
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] gridExtra_0.9.1 mgcv_1.8-4      nlme_3.1-119    plyr_1.8.1     
 [5] vcd_1.3-2       ggthemes_2.1.0  eeptools_0.3.1  MASS_7.3-37    
 [9] ggplot2_1.0.0   knitr_1.9      

loaded via a namespace (and not attached):
 [1] abind_1.4-0      arm_1.7-07       car_2.0-24       chron_2.3-45    
 [5] coda_0.16-1      colorspace_1.2-4 data.table_1.9.4 digest_0.6.8    
 [9] evaluate_0.5.5   foreign_0.8-62   formatR_1.0      gtable_0.1.2    
[13] htmltools_0.2.6  labeling_0.3     lattice_0.20-29  lme4_1.1-7      
[17] maptools_0.8-34  Matrix_1.1-5     memisc_0.96-10   minqa_1.2.4     
[21] munsell_0.4.2    nloptr_1.0.4     nnet_7.3-9       parallel_3.1.2  
[25] pbkrtest_0.4-2   proto_0.3-10     quantreg_5.11    Rcpp_0.11.4     
[29] reshape2_1.4.1   rmarkdown_0.5.1  scales_0.2.4     sp_1.0-17       
[33] SparseM_1.6      splines_3.1.2    stringr_0.6.2    tools_3.1.2     
[37] yaml_2.1.13